using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using MCWEBSITE.BUL;
using MCWEBSITE.ENTITY;

public partial class Modules_DVPJSC_wucDVPGallery : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.FillData();
        }
    }
    protected void FillData()
    {
        string Language = "vi-VN";

        DataSet lstwebsiteNewsInfo = new DataSet();
        lstwebsiteNewsInfo = websiteNewsBUL.SelectNtoMByLanguageByCatDS(1, 1000, Language, 3);

        PagedDataSource PagingController = new PagedDataSource();
        PagingController.DataSource = lstwebsiteNewsInfo.Tables[0].DefaultView;
        PagingController.AllowPaging = true;
        PagingController.PageSize = PagingObject.PageSize;
        PagingController.CurrentPageIndex = PagingObject.CurrentPage - 1;
        PagingObject.TotalPage = PagingController.PageCount;
        PagingObject.TotalRecord = lstwebsiteNewsInfo.Tables[0].Rows.Count;
        PagingObject.ReBindPaging();

        dlGallery.DataSource = PagingController;
        dlGallery.DataBind();
    }
    protected void PagingObject_PageSelectedIndexChanged(object sender, PageSelectedIndexChange e)
    {
        PagingObject.CurrentPage = e.SelectedPageIndex;
        FillData();
    }
}
